import sys
sys.path.append('../')


from ref_free_metrics.supert import Supert#评估方式
from utils.data_reader import CorpusReader#读取数据集部分



if __name__ == '__main__':
    #import nltk
    #nltk.download('stopwords')
    # pseudo-ref strategy: 
    # * top15 means the first 15 sentences from each input doc will be used to build the pseudo reference summary
    pseudo_ref = 'top15' 

    # read source documents
    reader = CorpusReader('data/CNN')#应该是读取了该主题下所有文档
    source_docs = reader()
    summaries = reader.readSummaries()

    # get unsupervised metrics for the summaries
    supert = Supert(source_docs, ref_metric=pseudo_ref) #第一步 输入源文档和参考摘要 构建伪参考摘要
    scores = supert(summaries)#第二步 输入生成的摘要 得到得分
    print('unsupervised metrics\n', scores)






